package deletedelete2;

/*
2、编写一个程序，已有若干学生数据，包括学号、姓名、成绩，要求输出这些学生数据并计算平均分。
*/

public class Stud {
     int no;
     String name;
     int deg;
     static int sum;
     static int num;
     static int average;

    public Stud(int no, String name, int deg) {
        this.no = no;
        this.name = name;
        this.deg = deg;
        sum+=deg;
        num++;
        average=sum/num;
    }

    public static void main(String[] args) {
        Stud s1=new Stud(1,"鱼骨头",88);
        Stud s2=new Stud(2,"情调神",90);
        Stud s3=new Stud(3,"雕笼",93);
        Stud s4=new Stud(4,"胖子",92);


        System.out.println("学生的总成绩为:"+sum);
        System.out.println("学生的平均成绩为:"+average);
    }


}
